<template>
  <view class="">
    <view class="circle-breath fixed bottom-36 right-6 w-[40px] h-[40px]" @click="handleRobot">
      <image src="@/static/images/robot-icon.gif" class="w-full h-full" mode="scaleToFill" />
    </view>
  </view>
</template>

<script lang="ts" setup>
const props = withDefaults(
  defineProps<{
    type?: string
  }>(),
  {
    type: '',
  },
)

const emits = defineEmits(['create'])
const handleRobot = () => {
  if (props.type === 'create') {
    emits('create')
  } else {
    uni.navigateTo({
      url: '/pages-sub/work-order/create?from=robot',
    })
  }
}
</script>

<style lang="scss" scoped>
.circle-breath {
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgb(204, 73, 152);
  animation: donghua 2.4s infinite;
}

@keyframes donghua {
  0% {
    /* 注意rgba中的a的设置 */
    box-shadow: 0 0 0 0 rgba(204, 73, 152, 60%);
    transform: scale(0.6);
  }

  60% {
    box-shadow: 0 0 0 36px rgba(204, 73, 152, 0%);
    transform: scale(0.8);
  }

  100% {
    box-shadow: 0 0 0 0 gba(204, 73, 152, 0%);
    transform: scale(0.6);
  }
}
</style>
